<?php

  //to do: improve the way to pass two or more parameters in the paged-table ( link )
    
  $aux = explode ( '|', $_GET['id'] );
  $index=0;
  $PayplanUid = str_replace ( '"', '', $aux[$index++] );

  require_once ( PATH_PLUGINS . 'hr' . PATH_SEP . 'class.hr.php');
  $pluginObj = new hrClass ();

  require_once ( "classes/model/HrPayPlan.php" );
  //if exists the row in the database propel will update it, otherwise will insert.
  $tr = HrPayPlanPeer::retrieveByPK( $PayplanUid  );
  
  if ( ( is_object ( $tr ) &&  get_class ($tr) == 'HrPayPlan' ) ) { 
     $fields['PAYPLAN_UID'] = $tr->getPayplanUid();
     $fields['LABEL_PAYPLAN_UID'] = $tr->getPayplanUid();
     $fields['PAYPLAN'] = $tr->getPayplan();
     $fields['LABEL_PAYPLAN'] = $tr->getPayplan();
     $fields['PAYPLANDESCRIPTION'] = $tr->getPayplandescription();
     $fields['LABEL_PAYPLANDESCRIPTION'] = $tr->getPayplandescription();
  }
  else
    $fields = array();  
  
  $G_MAIN_MENU = 'processmaker';
  $G_SUB_MENU = 'hr/menuhrParameters';
  $G_ID_MENU_SELECTED = 'ID_HR_PAR';
  $G_ID_SUB_MENU_SELECTED = '';


  $G_PUBLISH = new Publisher;
  $G_PUBLISH->AddContent('xmlform', 'xmlform', 'hr/hrPayPlanDelete', '', $fields, 'hrPayPlanDeleteExec' );
  G::RenderPage('publish', 'blank');   
?>